<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台（PHP版）
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码，建议反馈是我们前进的动力
// | 开源版本可自由商用，可去除界面版权logo
// | gitee下载：https://gitee.com/likeshop_gitee/likeadmin
// | github下载：https://github.com/likeshop-github/likeadmin
// | 访问官网：https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------

namespace app\adminapi\validate\user;


use app\common\validate\BaseValidate;


/**
 * User验证器
 * Class UserValidate
 * @package app\adminapi\validate
 */
class UserValidate extends BaseValidate
{

     /**
      * 设置校验规则
      * @var string[]
      */
    protected $rule = [
        'id' => 'require',
        'channel' => 'require',
        'app_id' => 'require',
        'promotion_link_id' => 'require',
        'sn' => 'require',
        'avatar' => 'require',
        'nickname' => 'require',
        'gender' => 'require',
        'city' => 'require',
        'mobile' => 'require',
        'status' => 'require',
        'login_ip' => 'require',
        'login_time' => 'require',
        'k_coin' => 'require',
        'paynum' => 'require',
        'paymoney' => 'require',
        'is_vip' => 'require',
        'vip_time' => 'require',
        'login_days' => 'require',
        'is_tourist' => 'require',
        'is_add_desktop' => 'require',
        'is_close' => 'require',
        'register_time' => 'require',
    ];


    /**
     * 参数描述
     * @var string[]
     */
    protected $field = [
        'id' => 'id',
        'channel' => '注册渠道 1抖音小程序2微信小程序',
        'app_id' => '应用ID',
        'promotion_link_id' => '推广链ID',
        'sn' => '用户SN',
        'avatar' => '用户头像',
        'nickname' => '昵称',
        'gender' => '用户性别，0: 未知；1:男性；2:女性',
        'city' => '城市',
        'mobile' => '手机号',
        'status' => '1正常0禁用',
        'login_ip' => '登录iP',
        'login_time' => '登录时间',
        'k_coin' => 'K币',
        'paynum' => '充值次数',
        'paymoney' => '累计充值',
        'is_vip' => '是否VIP0否1是',
        'vip_time' => 'vip到期时间',
        'login_days' => '登录天数',
        'is_tourist' => '1游客2用户',
        'is_add_desktop' => '是否加桌',
        'is_close' => '是否注销 0未注销 1注销',
        'register_time' => '注册时间',
    ];


    /**
     * @notes 添加场景
     * @return UserValidate
     * @author likeadmin
     * @date 2024/07/13 15:05
     */
    public function sceneAdd()
    {
        return $this->only(['channel','app_id','promotion_link_id','sn','avatar','nickname','gender','city','mobile','status','login_ip','login_time','k_coin','paynum','paymoney','is_vip','vip_time','login_days','is_tourist','is_add_desktop','is_close','register_time']);
    }


    /**
     * @notes 编辑场景
     * @return UserValidate
     * @author likeadmin
     * @date 2024/07/13 15:05
     */
    public function sceneEdit()
    {
        return $this->only(['id','channel','app_id','promotion_link_id','sn','avatar','nickname','gender','city','mobile','status','login_ip','login_time','k_coin','paynum','paymoney','is_vip','vip_time','login_days','is_tourist','is_add_desktop','is_close','register_time']);
    }


    /**
     * @notes 删除场景
     * @return UserValidate
     * @author likeadmin
     * @date 2024/07/13 15:05
     */
    public function sceneDelete()
    {
        return $this->only(['id']);
    }


    /**
     * @notes 详情场景
     * @return UserValidate
     * @author likeadmin
     * @date 2024/07/13 15:05
     */
    public function sceneDetail()
    {
        return $this->only(['id']);
    }

}